# Optional documentation generation.
# localwin32.mk is an optional file to override make variables.
# Use localwin32.mk instead of editing variables as it is included in sub
# makefiles.
# Use localwin32.mk to override RST2HTML, DOXYGEN

RST2HTML=python rst2html.py
SED=sed
DOXYGEN=doxygen
CP = copy /y
-include ../localwin32.mk

ifdef MSYS
CP = cp
endif

# no PDF rule yet
all: html api-doc

html: geany.html hacking.html

geany.html: geany.txt geany.css
	$(RST2HTML) -stg --stylesheet=geany.css $< $@

hacking.html: ../HACKING geany.css
	$(RST2HTML) -stg --stylesheet=geany.css $< $@

# FIXME: we should also replace @VERSION@
Doxyfile: Doxyfile.in
	$(CP) $< $@
	$(SED) -i 's/@top_builddir@/../g' $@
	$(SED) -i 's/@top_srcdir@/../g' $@

api-doc: Doxyfile
	$(DOXYGEN)

